<?php
/**
* @file php.php
* Systemblock PHP
*
* @author PortaMx - Portal Management Extension
* @author Copyright 2008-2011 by PortaMx - http://portamx.com
* @Version: 1.0 RC4
* @Date: 23.02.2011
*/

if(!defined('PortaMx'))
	die('This file can\'t be run without PortaMx');

/**
* @class pmxc_php
* Systemblock PHP
* @see php.php
* @author Copyright by PortaMx - http://portamx.com
*/
class pmxc_php extends PortaMxC_SystemBlock
{
	var $php_content;
	var $php_vars;

	/**
	* InitContent.
	* Check we have a init part
	*/
	function pmxc_InitContent()
	{
		if(preg_match('~\[\?pmx_initphp(.*)pmx_initphp\?\]~is', $this->cfg['content'], $match))
			eval($match[1]);

		return $this->visible;
	}

	/**
	* ShowContent
	* Output the content.
	*/
	function pmxc_ShowContent()
	{
		// Check we have a show part
		if(preg_match('~\[\?pmx_showphp(.*)pmx_showphp\?\]~is', $this->cfg['content'], $match))
			eval($match[1]);

		// else write out the content
		else
			eval($this->cfg['content']);
	}
}
?>